/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package xmlconvert.internalStructure;

/**
 *
 * @author ash
 */ 

import org.apache.log4j.Logger;

public class Field {
    
    private static Logger LOG = Logger.getLogger(Field.class);
    
    private String name;
    private String value;
    
    public static Field createField(String name, String value){
        try {
            Verifications.verifyField(name,value);
        } catch (VerificationException e){
                LOG.warn("Couldn't create field. " + e.getMessage());
                return null;
        }
        
        return new Field(name, value);
    }
    
    private Field(String n, String v){
        name=n;
        value=v;
        if (LOG.isDebugEnabled()){
            LOG.debug("New field created: name is [" + name + "], value is [" + value + "].");
        }
    }
    
    public String getName(){
        return name;
    }
    
    public String getValue(){
        return value;
    }
    

    
}
